<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, width=device-width">
    <style>
        body {
            font-family: monospace;
            white-space: pre;
        }
    </style>
</head>

<body>
    <script>
        var resText = 'text';
        var res = JSON.parse(resText);
        var result = res;
        function main() {
            var items = res.items;
            var indexs = [];
            var resultItems = {};
            for (i = 0; i < items.length; i++) {
                var item = items[i];
                var key = item.name + "-------" + item.kind;
                var value = item.url;

                indexs.push(key);
                resultItems[key] = value;

            }
            result.indexs = indexs;
            result.data = resultItems;
        }
        main();
        document.body.appendChild(document.createTextNode(JSON.stringify(result, null, 0)));
    </script>
</body>

</html>